using System;
using axCommerce.Data.Interface;

namespace axCommerce.Data
{
	public partial class Permission : ISimpleData
	{
		private Permission()
		{
		}

		public Permission(int iAccountId, int iAccessRoleId)
		{
			AccountId = iAccountId;
			AccessRoleId = iAccessRoleId;
		}

		public void Save()
		{
			CreatedDate = DateTime.Now;
			LastModifiedDate = DateTime.Now;
			IsDeleted = false;

			Insert();
		}

		public void UpdateInstance()
		{
			LastModifiedDate = DateTime.Now;

			Update();
		}

		public void MarkAsDeleted()
		{
			LastModifiedDate = DateTime.Now;
			IsDeleted = true;

			Update();
		}
	}
}

